Skip to content

Conversation

simoncaron
Copy link
Contributor

Followup on #307

So... when passing a variable like this in the role:

encryption_key: '{"kdf": null, "created": "2022-09-07T08:46:13+02:00", "modified": "2022-09-07T08:46:13+02:00", "data": "xxx", "fingerprint": "xxx"}'

it ends up as the following string in the proxmox_storage.py lib:

"{'kdf': None, 'created': '2022-09-07T08:46:13+02:00', 'modified': '2022-09-07T08:46:13+02:00', 'data': 'xxx', 'fingerprint': 'xxx'}"

which crashes since it's no longer a valid JSON.

"msg": "encryption_key needs to be valid JSON or set to 'autogen'."

If we change the encryption_key parameter to raw instead of string, it won't alter the format/content of the json string. After that we parse the raw json object to a string if it's not autogen and send that to the PVE api.

  • I tested with 'autogen' and it works properly
  • I tested with an invalid json and it fails with the proper error message
  • I tested with a valid json encryption key and it passed

Copy link
Owner

@lae lae left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lae lae merged commit 248def5 into lae:develop Aug 29, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants